import request from '@/utils/request'
//import qs from 'qs'

export function userPage(pageNum:number,pageSize:number,username:string){
    return request({
        url: '/auth/user/user',
        method: 'get',
        params:{
            pageNum: pageNum,
            pageSize: pageSize,
            username: username
        }
    })
}

export function deleteUser(id:string){
    return request({
        url: '/auth/user/user',
        method: 'delete',
        params:{
            id: id
        }
    })
}

export function getAllOptionalRoles(){
    return request({
        url: '/auth/role/role',
        method: 'get',
    })
}

export function assignRoles(userId:string,roleIds:any){
    return request({
        url: '/auth/user/role',
        method: 'post',
        data: {
            userId: userId,
            roleIds: roleIds
        }
    })
}

export function addUserFunc(user:any){
    return request({
        url: '/auth/user/user',
        method: 'post',
        data: user
    })
}

export function test(){
    return request({
        url: '/auth/user/test1',
        method: 'get'
    })
}
